import { useUserinfo } from '@/stores/userinfo'
export const permission = {
    mounted(el: HTMLElement, binding: { value: string[] }) {
        console.log("mounted", el, binding)
        const { userScope } = useUserinfo()
        if (!binding.value.find(item => userScope?.includes(item))) { 
            el.parentNode?.removeChild(el) 
        }
    }

}

// export const role = {
//     mounted(el: HTMLElement, binding: { value: string[] }) {
//         console.log("mounted", el, binding)
//         const { userScope } = useUserinfo()
//         if (!binding.value.find(item => userScope.includes(item))) { 
//             el.parentNode?.removeChild(el) 
//         }
//     }

// }
